<?
class zoekenController extends inabuurt_controller_action{



	public function indexAction(){
		
		$this -> view -> setTpl('bewonersgroepen_overzicht.php');
		$this -> view -> addStyle(view::PATH_TO_STYLE.'bewonersgroepen.css');
		
		require_once('./application/models/bewonersgroepModel.php');
		
		$form = new form('frm_zoeken', form::POST);
		$input = new form_element_textField('frm_input');
		$type = new form_element_textField('frm_type');
		
		$form -> addElementRange(array($input, $type));
		
		
		if($form -> isSend()){
			
			$model = bewonersgroepModel::getInstance($this -> conn);
			
			if($type -> getSend() == 0){
			
				$array = $model -> getBewonersgroepenByNaam($input -> getSend());
			
			}else{
				
				$array = $model -> getBewonersgroepenByLocatie($input -> getSend());
			
			}
			
			
			$list = new user_list($array);
		
		
			$this -> view -> bewList = $list -> renderPage(1);
		
		$this -> view -> zoeken = true;	
		$this -> view -> render();
	
		
		
		}
	
	
	}



}



?>